<?php

namespace App\Http\Controllers\FrontEnd;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Error;
use Illuminate\Support\Facades\DB;

class Home extends Controller
{
    public function index(Request $req)
    {

        return view('/index');
    }


    public function search(Request $req,$id){
        //根据id查询数据库
        try{
            $url = DB::table('captcha_data')->where('cap_id',$id)->get();
            $messsage = DB::table('captcha')->where('id',$id)->first();
        }catch(Error $err){
            return $err;
        }
        if($messsage == null){
            return '404';
        }

        return view('/line',[
            'url'=>$url,
            'messsage'=>$messsage->message
        ]);

    }



    //个人中心
    function myCenter(Request $req){
        return view('/myCenter');
    }

}
